import request from '@/utils/request'

/** 查询企业部门列表
 *
 */
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

/** 新增企业部门列表
 *
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/** 根据id删除企业部门
 *
 */
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

/** 根据id修改企业部门
 *
 */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

/** 根据id查询企业部门
 *
 */
export function idDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
